<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js">
    </script>
    <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>


<table id="datagrid" class="easyui-datagrid" title="详情表格 " style="width:260px;height:250px "
       data-options="singleSelect:true,collapsible:true "   >
    <thead>
    <tr>
        <th data-options="field:'name',width:128">类型</th>
        <th data-options="field:'value',width:130">总量</th>
    </tr>
    </thead>
</table>
<body>
 <script>
     var data= ['商场','超市','农贸市场'];
     var count = [12323,234324,23423]

var jsonArray =[];

     for(var i = 0;i<data.length;i++){
         var json = {};
         for(var j=0;j<count.length;j++){
             if(i==j){
                 json.value = count[j];
                 json.name = data[i];
                 jsonArray.push(json);
             }
         }
     }
     var cc = JSON.stringify(jsonArray)
     jsonData =  '{"rows":'+cc+'}'

     var needJsonData = JSON.parse(jsonData)

     $(document).ready(function () {
         $('#datagrid').datagrid({
             data:needJsonData.rows,
         })
     })
 </script>

</body>
</html>